package com.itlong.cloud.enumerate.ecode;


import lombok.Getter;
import lombok.Setter;

/**
 * <desc>
 *      小程序错误码定义
 * </desc>
 *
 * @create 2018/11/26
 */
public enum MiniProgramErrorCodeEnum {
    /*
    *mainCode为1表示APP模块错误，subCode可用范围为1至999；
   */
    SMSCODE_ERR(8,1,"请输入正确的验证码"),

    PHONE_NOT_MATCH(8,2,"手机号码格式错误，请重新输入"),

    SMSCODE_SEND_ERR(8,3,"验证码发送失败"),

    EXIST_PHONENO(8,4,"手机号码已存在"),

    USER_NOT_EXIST(8,5,"账号或密码错误,请重新输入"),

    ROOM_OWNER_PHONE_NOT_EXIST(8,6,"房间户主电话不存在"),

    ROOM_NOT_EXIST(8,7,"房间不存在，请重新选择"),

    UPDATE_PSWD_ERR(8,8,"账号或密码错误，修改密码失败"),

    NOT_EXIST_PHONENO(8,9,"该手机号未注册"),

    OPEN_DEFEATED(8,10,"开门失败"),
    OPEN_SUCCESS(8,11,"开门成功"),

    MINI_PROGRAM_SIGN_ERR(8,12,"参数签名错误"),
    SMSCODE_SEND_TO_MORE(8,13,"获取验证码次数过于频繁"),
    NOT_PARAM(8,14,"参数不匹配"),
    SMSCODE_EXPIRE(8,15,"验证码已过期"),
    PROJECT_ID_EMPTY_ERR(8,16,"项目编号不合法"),
    USER_TOKEN_ERROR(8,17,"您的登录已过期，请重新登录"),
    USER_ACCOUNT_REFUSE(8,18,"账号已禁用，请联系物业"),
    PROJECT_NOT_MATCH(8,19,"项目编号非法"),
    NOT_ADD_OPENAUTH_ERROR(8,20,"小区未开放邀请家人权限"),
    ROOM_NUM_MAX_ERROR(8,21,"%s房间入住人数已满！"),
    ADD_AUTHPERSON_SELF_ERROR(8,22,"户主不能邀请自己"),
    ADD_AUTHPERSON_EXIT_ERROR(8,23,"已经邀请过该用户"),
    VISIT_NAME_IS_NULL(8,23,"请填写访客姓名"),
    VISIT_NAME_IS_ERROR(8,24,"姓名格式错误，请重新输入"),
    VISIT_LIMIT_COUNT_IS_NULL(8,25,"有效使用次数不能为空"),
    VISIT_LIMIT_COUNT_IS_ERROR(8,26,"有效使用次数最大为10"),
    VISIT_PHONE_IS_NULL(8,27,"手机号为空"),
    VISIT_PHONE_IS_ERROR(8,28,"手机号格式错误，请重新输入"),
    VISIT_ROOM_IS_NULL(8,29,"请至少选择一个房间"),
    USER_PROJECT_FREEZE_NOT_AUTH(8,30,"您在当前项目的住户权限已被冻结，暂时无法邀请家人！"),
    PROJECT_IS_BANNED(8,31,"项目已禁用"),
    CLOUD_ENTRANCE_EXISTS(8,32,"云门禁设备不存在"),
    VISITOR_PHONE_CHECK_NOTPASS(8,33,"该手机号码验证不通过，请重新输入！"),
    NOT_ALLOWED_VISITOR(8,34,"该手机号码验证不通过，不能发起对自己房屋访客预约！"),
    VISITOR_CHECKED_NOT_ALLOWED_AUTH(8,35,"审批已通过，不允许重新认证！"),
    H5_DEVICEUNIQUE_EMPTY_ERR(8,36,"设备编号不能为空"),
    H5_DEVICETYPE_EMPTY_ERR(8,37,"设备类型不能为空"),
    H5_ROOMID_USERID_EMPTY_ERR(8,38,"用户编号和房间编号不能同时为空"),
    H5_USERID_EMPTY_ERR(8,39,"用户编号不能为空"),
    COUPON_NOT_EXIST_ERR(8,40,"该优惠券不存在"),
    COUPON_REDEEM_STATUS_ERR(8,41,"该优惠券已被兑换"),
    COUPON_END_TIME_GONE_ERR(8,42,"该优惠券已过期"),
    USER_IN_PROJECT_NO_ROOM(8,43,"您不是该小区住户"),
    BANK_CARD_SEND_MESSAGE_COUNT_SURPASS(8,44,"短信发送频繁，请10分钟后再做尝试"),
    QR_CODE_PASS_TIME_OR_NOT_EXISTS_ERR(8,45, "二维码不存在或已过期，请重试"),
    ;
    @Setter
    @Getter
    private ErrorCode errorCode = new ErrorCode();


    MiniProgramErrorCodeEnum(){}
    @Getter
    private String codeMsg;



    /**
     * <desc>
     *     主错误码与错误信息构造函数
     * </desc>
     * @param mainCode
     * @param codeMsg
     */
    MiniProgramErrorCodeEnum(Integer mainCode, String codeMsg) {
        errorCode.setMainCode(mainCode);
        errorCode.setSubCode(0);
        errorCode.setCodeMsg(codeMsg);
    }

    /**
     * <desc>
     *     全参构造函数
     * </desc>
     * @param mainCode
     * @param subCode
     * @param codeMsg
     */
    MiniProgramErrorCodeEnum(Integer mainCode, Integer subCode, String codeMsg){
        this.codeMsg=codeMsg;
        errorCode.setMainCode(mainCode);
        errorCode.setSubCode(subCode);
        errorCode.setCodeMsg(codeMsg);
    }



}
